package com.woniu.service.command;

import com.alibaba.fastjson.JSONObject;
import com.woniu.util.ApplicationContextHolder;
import lombok.Data;

import java.net.URISyntaxException;

/**
 * @description:
 * @author: my
 * @time: 2021/4/22 9:39
 */
@Data
public class FundPositionCommand {
    private FundPositionCommandHandler handler;
    private String code;

    public FundPositionCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(FundPositionCommandHandler.class);
    }

    public FundPositionCommand(String code){
        this();
        this.code = code;
    }

    public JSONObject execute() throws URISyntaxException {
        return this.handler.action(this);
    }
}
